﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ManageEmployees.ascx.cs" Inherits="ManageEmployees" %>
<%@ Register assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" namespace="System.Web.UI.WebControls" tagprefix="asp" %>

<script type="text/javascript" language="javascript">
    function confirm() {
        alert("This is my alert message");
    }
</script>

<h3>Manage Employees</h3>

<%-- stores library ID, loaded from page load,  --%>
    <asp:Label ID="lblLibID" runat="server" Text=" " Visible="false"></asp:Label>

<div  class="featurebox_center">
<%--add new person button--%>
<%--<asp:Button ID="btnAddNewPerson" runat="server" Text="Add New Person" 
    onclick="btnAddNewPerson_Click" />
<br />
<br />--%>

<%--search for a person--%>
<h4><asp:Label ID="lblSearch" runat="server" Text="Search by Last Name, Phone Number, or Email: "></asp:Label></h4>
<br />
<asp:TextBox ID="txtFindPerson" runat="server"></asp:TextBox>
<asp:Button ID="btnFindPerson" runat="server" Text="Find Employee" onclick="btnFindPerson_Click" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="btnAddNew" runat="server" Text="Add New Employee" onclick="btnAddNew_Click" />
<%--<asp:Button ID="test2" runat="server" Text="javascript test 2"  />
<button ID="test1" runat="server" title="javascript test 1"  onclick="confirm();" />--%>
<br /><br />
<div class="confirmLabel">
    <asp:Label ID="lblNoResults" runat="server" Text=""></asp:Label>
</div>
<br />

<%--grid displays results of searching for a person--%>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="PersonID" DataSourceID="SqlDataSource2" AllowPaging="True" 
    AllowSorting="True"  >
    <Columns>
        <asp:BoundField DataField="PersonId" HeaderText="Id" SortExpression="Id" />
        <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="First Name" />
        <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="Last Name" />
        <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
        <asp:BoundField DataField="City" HeaderText="City" SortExpression="City" />
        <asp:BoundField DataField="State" HeaderText="State" SortExpression="State" 
            ControlStyle-Width="30px" > <ControlStyle Width="30px"></ControlStyle></asp:BoundField>
        <asp:BoundField DataField="Zip" HeaderText="Zip" SortExpression="Zip" />
        <asp:BoundField DataField="PhoneNumber" HeaderText="Phone Number" ControlStyle-Width="96px"
            SortExpression="PhoneNumber" > <ControlStyle Width="95px"></ControlStyle> </asp:BoundField>
        <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
        <asp:BoundField DataField="Level" HeaderText="Employee Level" NullDisplayText="Not An Employee" />
        <asp:CommandField ShowSelectButton="True" SelectText="Select" ButtonType="Link" 
            EditText="Select" />
    </Columns>
    <HeaderStyle Font-Bold="True" ForeColor="#2153AA" />
</asp:GridView>

<%--sql data source for data grid and detail view--%>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" OnSelected="SqlDataSource2_Selected"
    ConnectionString="<%$ ConnectionStrings:BPI_LibraryConnectionString %>" 
    SelectCommand="usp_PERSON_FindPersonEmployee" SelectCommandType="StoredProcedure" 
    UpdateCommand="usp_PERSON_UpdatePersonEmployee" UpdateCommandType="StoredProcedure" 
    InsertCommand="usp_PERSON_InsertPerson" InsertCommandType="StoredProcedure" >
    <SelectParameters>
        <asp:ControlParameter ControlID="txtFindPerson" Name="value"
            PropertyName="Text" Type="String" />
    </SelectParameters>
</asp:SqlDataSource>

<%--sql data source for state drop down box--%>
<asp:SqlDataSource ID="sqlDataSource_states" runat="server" 
    ConnectionString="<%$ ConnectionStrings:BPI_LibraryConnectionString %>" 
    SelectCommand="sp_GetStates" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<%-- sql data source for contact method drop down box --%>
<asp:SqlDataSource ID="sqlDataSource_contactMethod" runat="server" 
    ConnectionString="<%$ ConnectionStrings:BPI_LibraryConnectionString %>" 
    SelectCommand="usp_PATRON_GetContactMethod" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<%--sql data source for employee level radio buttons--%>
<asp:SqlDataSource ID="sqlDataSource_EmployeeLevel" runat="server" 
    ConnectionString="<%$ ConnectionStrings:BPI_LibraryConnectionString %>" 
    SelectCommand="usp_EMPLOYEE_GetEmployeeLevel" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<%--sql datasource for details view--%>
<asp:SqlDataSource 
    ID="SqlDataSource3" runat="server"
    ConnectionString="<%$ ConnectionStrings:BPI_LibraryConnectionString %>" 
    SelectCommand="sp_EMPLOYEE_PopulateDetailsGrid" SelectCommandType="StoredProcedure"
    UpdateCommand="usp_PERSON_UpdatePersonEmployee" UpdateCommandType="StoredProcedure"
    InsertCommand="usp_PERSON_InsertPersonEmployee" InsertCommandType="StoredProcedure">
    <SelectParameters>
        <asp:ControlParameter ControlID="GridView1" Name="PersonID"  
            PropertyName="SelectedValue" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>
<br />
<br />

<%--displays detail view of selected item in data grid--%>
<asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource3" DataKeyNames="PersonId" 
     AutoGenerateRows="False" OnItemUpdated="DetailsView1_ItemUpdated" GridLines="None"
     OnItemInserted="DetailsView_ItemInserted" >
    <RowStyle Font-Bold="False" ForeColor="Black" />
    <FieldHeaderStyle Font-Bold="True" ForeColor="#2153AA" />
    <Fields>
        <%--Id--%>
        <asp:TemplateField HeaderText="Id">
            <EditItemTemplate>
                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("PersonId") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvID" ControlToValidate="TextBox1" runat="server"
                    ErrorMessage="You must enter an Id" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("PersonId") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvID" ControlToValidate="TextBox2" runat="server"
                    ErrorMessage="You must enter an Id" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label10" runat="server" Text='<%# Bind("PersonId") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--First Name--%>
        <asp:TemplateField HeaderText="First Name">
            <EditItemTemplate>
                <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvFirstName" ControlToValidate="txtFirstName" runat="server"
                    ErrorMessage="You must enter a First Name" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Bind("FirstName") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvFirstName" ControlToValidate="txtFirstName" runat="server"
                    ErrorMessage="You must enter a First Name" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Bind("FirstName") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Last Name--%>
        <asp:TemplateField HeaderText="Last Name">
            <EditItemTemplate>
                <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvLastName" ControlToValidate="txtLastName" runat="server"
                    ErrorMessage="You must enter a Last Name" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtLastName" runat="server" Text='<%# Bind("LastName") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvLastName" ControlToValidate="txtLastName" runat="server"
                    ErrorMessage="You must enter a Last Name" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Bind("LastName") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Address--%>
        <asp:TemplateField HeaderText="Address">
            <EditItemTemplate>
                <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvAddress" ControlToValidate="txtAddress" runat="server"
                    ErrorMessage="You must enter an Address" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("Address") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvAddress" ControlToValidate="txtAddress" runat="server"
                    ErrorMessage="You must enter an Address" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label4" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--City--%>
        <asp:TemplateField HeaderText="City">
            <EditItemTemplate>
                <asp:TextBox ID="txtCity" runat="server" Text='<%# Bind("City") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCity" ControlToValidate="txtCity" runat="server"
                    ErrorMessage="You must enter a City" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtCity" runat="server" Text='<%# Bind("City") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvCity" ControlToValidate="txtCity" runat="server"
                    ErrorMessage="You must enter a City" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label5" runat="server" Text='<%# Bind("City") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--State--%>
        <asp:TemplateField HeaderText="State">
            <EditItemTemplate>
                <asp:DropDownList ID="ddStates" runat="server" DataSourceID="sqlDataSource_states" Text='<%# Bind("State") %>' DataTextField="State" DataValueField="State"></asp:DropDownList>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:DropDownList ID="ddStates" runat="server" DataSourceID="sqlDataSource_states" Text='<%# Bind("State") %>' DataTextField="State" DataValueField="State"></asp:DropDownList>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("State") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Zip--%>
        <asp:TemplateField HeaderText="Zip">
            <EditItemTemplate>
                <asp:TextBox ID="txtZip" runat="server" Text='<%# Bind("Zip") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvZip" ControlToValidate="txtZip" runat="server"
                    ErrorMessage="You must enter a Zip Code" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator ID="revZip" ControlToValidate="txtZip" runat="server"
                    ErrorMessage="You must enter a 5 digit zip" 
                    ValidationExpression="\d{5}(-\d{4})?" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtZip" runat="server" Text='<%# Bind("Zip") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvZip" ControlToValidate="txtZip" runat="server"
                    ErrorMessage="You must enter a Zip Code" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator ID="revZip" ControlToValidate="txtZip" runat="server"
                    ErrorMessage="You must enter a 5 digit zip" 
                    ValidationExpression="\d{5}(-\d{4})?" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label6" runat="server" Text='<%# Bind("Zip") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Phone Number--%>
        <asp:TemplateField HeaderText="Phone Number">
            <EditItemTemplate>
                <asp:TextBox ID="txtPhone" runat="server" Text='<%# Bind("PhoneNumber") %>'></asp:TextBox>
                <asp:RegularExpressionValidator ID="revPhone" ControlToValidate="txtPhone" runat="server"
                    ErrorMessage="Please enter a 10 digit phone number with no symbols" 
                    ValidationExpression="\d{10}\s?" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtPhone" runat="server" Text='<%# Bind("PhoneNumber") %>'></asp:TextBox>
                <asp:RegularExpressionValidator ID="revPhone" ControlToValidate="txtPhone" runat="server"
                    ErrorMessage="Please enter a 10 digit phone number without symbols" 
                    ValidationExpression="\d{10}\s?" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label7" runat="server" Text='<%# Bind("PhoneNumber") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Email--%>
        <asp:TemplateField HeaderText="Email">
            <EditItemTemplate>
                <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                <asp:RegularExpressionValidator ID="revEmail" ControlToValidate="txtEmail" runat="server"
                    ErrorMessage="Please enter a valid email address" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\s*" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtEmail" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                <asp:RegularExpressionValidator ID="revEmail" ControlToValidate="txtEmail" runat="server"
                    ErrorMessage="Please enter a valid email address" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*\s*" ValidationGroup="meRegExp"></asp:RegularExpressionValidator>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label8" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Preferred Contact Method--%>
        <asp:TemplateField HeaderText="Preferred Contact Method  ">
            <EditItemTemplate>
                <asp:DropDownList ID="ddContact" runat="server" DataSourceID="sqlDataSource_contactMethod" 
                     Text='<%# Bind("PreferredContactMethod") %>' DataTextField="ContactMethod" 
                     DataValueField="ContactMethod"></asp:DropDownList>
                <asp:RequiredFieldValidator ID="rfvContact" ControlToValidate="ddContact" runat="server"
                    ErrorMessage="You must select a contact method" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:DropDownList ID="ddContact" runat="server" DataSourceID="sqlDataSource_contactMethod" 
                     Text='<%# Bind("PreferredContactMethod") %>' DataTextField="ContactMethod" 
                     DataValueField="ContactMethod"></asp:DropDownList>
                <asp:RequiredFieldValidator ID="rfvContact" ControlToValidate="ddContact" runat="server"
                    ErrorMessage="You must select a contact method" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Bind("PreferredContactMethod") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Password--%>
        <asp:TemplateField HeaderText="Password">
            <EditItemTemplate>
                <asp:TextBox ID="txtPassword" runat="server" Text='<%# Bind("Password") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPassword" ControlToValidate="txtPassword" runat="server"
                     ErrorMessage="You must enter a Password" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator id="revPassword" ControlToValidate="txtPassword" runat="server"
                    ErrorMessage="The password must have at lease one uppercase and one lowercase letter, one number, and be at least 8 characters." 
                    ValidationExpression="^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$" ValidationGroup="meRegExp">
                </asp:RegularExpressionValidator>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtPassword" runat="server" Text='<%# Bind("Password") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPassword" ControlToValidate="txtPassword" runat="server"
                    ErrorMessage="You must enter a Password" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator id="revPassword" ControlToValidate="txtPassword" runat="server"
                    ErrorMessage="The password must have at lease one uppercase and one lowercase letter, one number, and be at least 8 characters." 
                    ValidationExpression="^.*(?=.{10,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$" ValidationGroup="meRegExp">
                </asp:RegularExpressionValidator>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="lblPassword" runat="server" Text='<%# Bind("Password") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Card Expires--%>
        <asp:TemplateField HeaderText="Card Expires">
            <EditItemTemplate>
                <asp:TextBox ID="txtCardExpires" runat="server" Text='<%# Bind("CardExpires") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvExpire" ControlToValidate="txtCardExpires" runat="server"
                     ErrorMessage="You must enter an expiration date" ValidationGroup="meRequired"> </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator ID="revExpire" ControlToValidate="txtCardExpires"
                     runat="server" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d(\s([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])(\sAM|PM))?"
                     ErrorMessage="Please enter a valid date in mm/dd//yyyy format" ValidationGroup="meRegExp">
                </asp:RegularExpressionValidator>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:TextBox ID="txtCardExpires" runat="server" Text='<%# Bind("CardExpires") %>'></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvExpire" ControlToValidate="txtCardExpires" runat="server"
                    ErrorMessage="You must enter an expiration date" ValidationGroup="meRequired"> 
                </asp:RequiredFieldValidator> 
                <asp:RegularExpressionValidator ID="revExpire" ControlToValidate="txtCardExpires"
                     runat="server" ValidationExpression="(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d(\s([0-1][0-9]|[2][0-3]):([0-5][0-9]):([0-5][0-9])(\sAM|PM))?"
                     ErrorMessage="Please enter a valid date in mm/dd//yyyy format" ValidationGroup="meRegExp">
                </asp:RegularExpressionValidator>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="lblCardExpires" runat="server" Text='<%# Bind("CardExpires") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%-- Is Adult --%>
        <asp:TemplateField HeaderText="Adult Patron?">
            <EditItemTemplate>
                <asp:CheckBox ID="cbEditAdult" runat="server" Text="Yes" Checked='<%# Bind("isAdult") %>' />
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:CheckBox ID="cbInsertAdult" runat="server" Text="Yes" Checked='<%# Bind("isAdult") %>' />
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="cbAdult" runat="server" Text="Yes" Checked='<%# Bind("isAdult") %>' 
                     Enabled="false"/>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Wants Newsletter--%>
        <asp:TemplateField HeaderText="Wants Newsletter?">
            <EditItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" 
                    Checked='<%# Bind("wantsNewsletter") %>' />
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes"
                    Checked='<%# Bind("wantsNewsletter") %>' />
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes"
                    Checked='<%# Bind("wantsNewsletter") %>' Enabled="false" />
            </ItemTemplate>
        </asp:TemplateField>
        <%-- Wants Notifications --%>
        <asp:TemplateField HeaderText="Wants Notifications?">
            <EditItemTemplate>
                <asp:CheckBox ID="cbEditNotif" runat="server" Text="Yes" Checked='<%# Bind("wantsNotifications") %>' />
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:CheckBox ID="cbInsertNotif" runat="server" Text="Yes" Checked='<%# Bind("wantsNotifications") %>' />
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="cbEditNotif" runat="server" Text="Yes" 
                     Checked='<%# Bind("wantsNotifications") %>' Enabled="false"/>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Wants Newsletter--%>
        <%--<asp:TemplateField HeaderText="Wants Newsletter?">
            <EditItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes" 
                    Checked='<%# Bind("wantsNewsletter") %>' />
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes"
                    Checked='<%# Bind("wantsNewsletter") %>' />
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:CheckBox ID="CheckBox1" runat="server" Text="Yes"
                    Checked='<%# Bind("wantsNewsletter") %>' Enabled="false" />
            </ItemTemplate>
        </asp:TemplateField>--%>
        <%--Access Level--%>
        <asp:TemplateField HeaderText="Access Level">
            <EditItemTemplate>
                <asp:RadioButtonList ID="rbAccess" runat="server" DataSourceID="sqlDataSource_EmployeeLevel" 
                    DataTextField="EmployeeLevels" DataValueField="EmployeeLevels"
                    SelectedValue='<%# Bind("Level") %>'>
                    <asp:ListItem Text="Librarian" Value="Librarian" Enabled="true">Librarian</asp:ListItem>
                    <asp:ListItem Text="Volunteer" Value="Volunteer" enabled="true">Volunteer</asp:ListItem>
                    <asp:ListItem Text="" Value="" enabled="false"></asp:ListItem>
                </asp:RadioButtonList>
            </EditItemTemplate>
            <InsertItemTemplate>
                <asp:RadioButtonList ID="rbAccess2" runat="server" DataSourceID="sqlDataSource_EmployeeLevel" 
                    DataTextField="EmployeeLevels" DataValueField="EmployeeLevels"
                    SelectedValue='<%# Bind("Level") %>'>
                    <asp:ListItem Text="Librarian" Value="Librarian" Enabled="true">Librarian</asp:ListItem>
                    <asp:ListItem Text="Volunteer" Value="Volunteer" enabled="true">Volunteer</asp:ListItem>
                </asp:RadioButtonList>
            </InsertItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Label9" runat="server" Text='<%# Bind("Level") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <%--Footer Buttons--%>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True" ButtonType="Button" />
    </Fields>
    <HeaderStyle Font-Bold="True" ForeColor="#2153AA" />
    </asp:DetailsView>
    
    <div class="confirmLabel">
    <br />
            <asp:Label ID="lblConfirm" runat="server" Text="" Class="confirmLabel"></asp:Label>
    </div>

</div>